<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div>

    </div>
    <script src="js/template-web.js"></script>
    <script type="text/html" id="wen-ben">
    <ul>
        <li>{{msg}}</li>
        {{if ass}}
        <li>2</li>
        {{/if}}
       {{each arr}}
        <li>{{$index}}{{$value.name}}{{$value.eag}}</li>
        {{/each}}
        <li>4</li>
        <li>5</li>
    </ul>
    </script>
    <script>
        let ass=false
        let msg=123
        let arr=[{
            name:'名字',
            eag:'18'
        },
    {
        name:'不知道',
        eag:'17'
    }
    ]
        
        // console.log(template);
        let goodsHTML=template("wen-ben",{msg,ass,arr})
    //    console.log(goodsHTML);
const divs=document.querySelector("div")
divs.innerHTML=goodsHTML
    </script>
</body>
</html>